home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Adobe Air 1.5 / AdobeAIRInstaller.exe / setup.swf / scripts / mx / collections / ArrayCollection.as next >
Encoding:
Text File  |  2008-10-29  |  1.4 KB  |  61 lines

  1. package mx.collections
  2. {
  3.    import flash.utils.IDataInput;
  4.    import flash.utils.IDataOutput;
  5.    import flash.utils.IExternalizable;
  6.    import mx.core.mx_internal;
  7.    
  8.    use namespace mx_internal;
  9.    
  10.    public class ArrayCollection extends ListCollectionView implements IExternalizable
  11.    {
  12.       mx_internal static const VERSION:String = "3.0.0.0";
  13.       
  14.       public function ArrayCollection(param1:Array = null)
  15.       {
  16.          super();
  17.          this.source = param1;
  18.       }
  19.       
  20.       public function set source(param1:Array) : void
  21.       {
  22.          list = new ArrayList(param1);
  23.       }
  24.       
  25.       public function readExternal(param1:IDataInput) : void
  26.       {
  27.          if(list is IExternalizable)
  28.          {
  29.             IExternalizable(list).readExternal(param1);
  30.          }
  31.          else
  32.          {
  33.             source = param1.readObject() as Array;
  34.          }
  35.       }
  36.       
  37.       public function writeExternal(param1:IDataOutput) : void
  38.       {
  39.          if(list is IExternalizable)
  40.          {
  41.             IExternalizable(list).writeExternal(param1);
  42.          }
  43.          else
  44.          {
  45.             param1.writeObject(source);
  46.          }
  47.       }
  48.       
  49.       [Bindable("listChanged")]
  50.       public function get source() : Array
  51.       {
  52.          if(Boolean(list) && list is ArrayList)
  53.          {
  54.             return ArrayList(list).source;
  55.          }
  56.          return null;
  57.       }
  58.    }
  59. }
  60.  
  61.